package com.yl.project.lvyou.comments.service.impl;

import java.util.List;
import com.yl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yl.project.lvyou.comments.mapper.ScenicCommentsMapper;
import com.yl.project.lvyou.comments.domain.ScenicComments;
import com.yl.project.lvyou.comments.service.IScenicCommentsService;
import com.yl.common.utils.text.Convert;
import com.yl.framework.config.BaseService;

/**
 * 景区评论Service业务层处理
 * 
 * @author yl
 * @date 2025-03-14
 */
@Service
public class ScenicCommentsServiceImpl extends BaseService<ScenicComments> implements IScenicCommentsService 
{
    @Autowired
    private ScenicCommentsMapper scenicCommentsMapper;

    /**
     * 查询景区评论
     * 
     * @param id 景区评论ID
     * @return 景区评论
     */
    @Override
    public ScenicComments selectScenicCommentsById(Long id)
    {
        return scenicCommentsMapper.selectScenicCommentsById(id);
    }

    /**
     * 查询景区评论列表
     * 
     * @param scenicComments 景区评论
     * @return 景区评论
     */
    @Override
    public List<ScenicComments> selectScenicCommentsList(ScenicComments scenicComments)
    {
        return scenicCommentsMapper.selectScenicCommentsList(scenicComments);
    }

    /**
     * 新增景区评论
     * 
     * @param scenicComments 景区评论
     * @return 结果
     */
    @Override
    public int insertScenicComments(ScenicComments scenicComments)
    {
        scenicComments.setCreateTime(DateUtils.getNowDate());
        return scenicCommentsMapper.insertScenicComments(scenicComments);
    }

    /**
     * 修改景区评论
     * 
     * @param scenicComments 景区评论
     * @return 结果
     */
    @Override
    public int updateScenicComments(ScenicComments scenicComments)
    {
        scenicComments.setUpdateTime(DateUtils.getNowDate());
        return scenicCommentsMapper.updateScenicComments(scenicComments);
    }

    /**
     * 删除景区评论对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteScenicCommentsByIds(String ids)
    {
        return scenicCommentsMapper.deleteScenicCommentsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除景区评论信息
     * 
     * @param id 景区评论ID
     * @return 结果
     */
    @Override
    public int deleteScenicCommentsById(Long id)
    {
        return scenicCommentsMapper.deleteScenicCommentsById(id);
    }

    @Override
    public List<ScenicComments> selectScenicCommentsListApp(ScenicComments scenicComments) {
        return scenicCommentsMapper.selectScenicCommentsListApp(scenicComments);
    }
}
